package com.ruan.controller;

import com.ruan.entity.Address;
import com.ruan.entity.R;
import com.ruan.service.AddressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName:AddressController
 * @Author:阮昇
 * @Description:
 * @Datetime: 2023/9/27 9:52
 **/
@RestController
@RequestMapping("/address")
@Api(tags = "地址相关接口")
public class AddressController {

    @Autowired
    private AddressService addressService;

    @ApiOperation(value = "根据ownName获取地址信息")
    @ApiImplicitParam(name = "ownName",value = "所属人名称",dataType = "String",paramType = "query")
    @GetMapping("/getAddressByOwnName")
    public R<Address> getAddressByOwnName(String ownName){
        return addressService.getAddressByOwnName(ownName);
    }

}
